package com.hujing.exception;

public class ExceptionDemo5 {

    public static void main(String[] args) {
        try {
            getScore();
        } catch (ScoreException e) {
            e.printStackTrace();
        }
        System.out.println("************");
    }
    
    public static void getScore() throws ScoreException{
        int score = 200;
        if (score < 0 || score >100){
            throw new ScoreException("不合法的分数");
        }
    }
}

class ScoreException extends Exception{
    public ScoreException(){
        super();
    }
    
    public ScoreException(String msg){
        super(msg);
    }
}
